<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Document</title>
    <link rel="stylesheet" href="../node_modules/layui/src/css/layui.css">
    <script src="../node_modules/layui/src/layui.js"></script>
</head>
<body>
    <div class="layui-container">
        <form class="layui-form" action="">
            <div style="margin-top: 20px;">
                <div class="layui-form-label">
                    自定义Key
                </div>
    
                <div class="layui-input-block">
                    <input type="text" name="key" required lay-verify="required" placeholder="请输入自定义Key" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div style="margin-top:20px;">
                <div class="layui-form-label">
                    自定义Value
                </div>

                <div class="layui-input-block">
                    <input type="text" name="value" required lay-verify="required" placeholder="请输入自定义Value" autocomplete="off" class="layui-input">
                </div>
            </div>


            <div class="layui-form-item">
                <div style="margin-top: 30px;">
                    <p style="text-align:center">
                        <button type="button" lay-submit lay-filter="addQuality" class="layui-btn layui-btn-radius layui-btn-normal">确认</button>
                        <button type="reset" class="layui-btn layui-btn-radius layui-btn-danger">重置</button>
                    </p>
                </div>
            </div>
        </form>


    </div>

    <script type="text/javascript">
        layui.use(['layer','form'],function(){
            var layer = layui.layer,
            form = layui.form,
            $ = layui.$;

            form.on('submit(addQuality)',function(obj){
                // console.log(parent.layui.getrowselect(obj.field.key,obj.field.value));
                console.log(obj.field);
                parent.layui.tableAddQuality(obj.field.key,obj.field.value);
                
                return false;
            });
        });
    </script>
</body>
</html>